package DesignPatern.A22_享元模式.A02_抽象模式;

/**
 * @Author: Du
 * @Date: 2021/8/12 15:17
 */
public class A01_Main
{
    public static void main(String[] args)
    {
        int extrinsic = 0;
    
        FlyWeight flyweightX = FlyWeightFactory.getFlyWeight("X");
        flyweightX.operate(++ extrinsic);
    
        FlyWeight flyweightY = FlyWeightFactory.getFlyWeight("Y");
        flyweightY.operate(++ extrinsic);
    
        FlyWeight flyweightZ = FlyWeightFactory.getFlyWeight("Z");
        flyweightZ.operate(++ extrinsic);
    
        FlyWeight flyweightReX = FlyWeightFactory.getFlyWeight("X");//内部元素享元
        flyweightReX.operate(++ extrinsic);
    }
}
